
import hashlib
import re

def get_md5(data):
    #判断是否是unicode
    if isinstance(data,str):
        data=data.encode("utf-8")

    m=hashlib.md5()
    m.update(data)
    return m.hexdigest()

def extract_number(value):
    value_re = re.match(".*?(\d+).*", value)
    if value_re:
        number = int(value_re.group(1))
    else:
        number = 0

    return number

if __name__=='__main__':
    print(get_md5("http://www.ixuea.com".encode("utf-8")))